This invention relates generally to the implementation of complex computations in an environment that has limited storage and execution resources. More particularly, this invention relates to transferring data from external memory to a local memory of a processor.
In certain areas of computing, for example in the audio/video field, complex algorithms must often be performed to decompress and manipulate audio and video data so that the data can be broadcast in real time. In the use of MPEG protocols to transmit data, for example, header information is removed from the payload data before the payload data can be displayed or played. Similarly, where the data is compressed, the data must be decompressed so that it can be put to use. A variety of other processes are similarly performed on the data in order to manipulate it.
In a processor with limited resources, however, this manipulation is often difficult to achieve in a time efficient manner. Namely, a processor with a limited local memory can only store a small amount of code to be executed and its accompanying data. Hence, a complete application program typically cannot be loaded into the local memory all at once. Therefore, there is a need for a system that can load code into the processor's local memory in an efficient manner while the existing code resident in the processor is being executed.
Another drawback created by a small local memory is the start and stop nature of loading code into the local memory. Only a small amount of code can be stored by the small local memory. Hence, space in local memory typically must become available before it can be refilled with unexecuted code. Furthermore, the code that is being used to refill the space typically should be loaded by the time the remaining code finishes execution in order to achieve maximum efficiency. Thus, there is a tradeoff between waiting for enough space in local memory to become available and completely loading a space of local memory by the time the previous code has finished loading. Consequently, there is a need for a system that allows a transfer of data to be estimated such that the transfer of code from external memory to internal memory can be completed by the time the resident code completes execution.